﻿@model IEnumerable<CloudFranceTriple.Models.AccountingEntrySet>
@{
    ViewBag.Title = CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryIndexTitle;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="content-padding">
    <h1>@CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryIndexTitle</h1>
    <section>
        <br />
        @if (User.IsInRole("RoleAdminAccount"))
        {
            <p>
                @Html.ActionLink(@CloudFranceTriple.WebRole.Properties.Resources.ButtonAccoutingEntryCreate, "Create") | 
                @Html.ActionLink(@CloudFranceTriple.WebRole.Properties.Resources.ButtonTeamAccountManage, "Index", "TeamAccount", new { area = "Member" }, null)
            </p>
        }
        <br />
        <table>
            <thead>
                <tr>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.TeamAccountLabel
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryActor
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryLabel
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryPurchaseDate
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryBankDate
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryDebitAmount
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryCreditAmount
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryAuthor
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {               
                    <tr>
                        <td>
                            @Html.DisplayFor(modelItem => item.AccountSet.Label)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Actor)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Label)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.PurchaseDate, "TemplateUserDate")
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.BankDate, "TemplateUserDate")
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.DebitAmount)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.CreditAmount)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Author)
                        </td>
                    </tr>
                }
                <tr>
                    <td colspan="3">
                        <h3>@CloudFranceTriple.WebRole.Properties.Resources.AccountingEntrySold</h3>
                    </td>
                    <td>
                        <h3>@CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryPurchaseSold</h3>
                    </td>
                    <td>
                        <h3>@CloudFranceTriple.WebRole.Properties.Resources.AccountingEntryBankSold</h3>
                    </td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                @Html.Action("ShowSold", "AccountingEntry", new { area = "Member" })

            </tbody>
        </table>
        <br />
        <br />
    </section>
</div>
